package aaaaa;

import java.util.PriorityQueue;

public class MyPriorityQueue {

    public static void main(String[] args) {
        // 靠 Comparator 实现
        PriorityQueue queue = new PriorityQueue();
        queue.offer(2);
        queue.offer(3);
        queue.offer(1);
        queue.offer(6);

        while (!queue.isEmpty()) {
            System.out.println(queue.poll());
        }
    }
}
